﻿using System;

namespace DesignPattern.com.state.scene {
    public class GameController {
        
        SceneController sc=new SceneController();

        public void Awake(){
            Console.WriteLine("==GameController-Awake()");
            
            
            //转换场景不会被删除
//            GameObject.DontDestroyOnload(this.gameObject);
            Console.WriteLine("转换场景不会被删除 GameObject.DontDestroyOnload(this.gameObject);");
            
            //随机种子
//            UnityEngine.Random.seed = (int) DateTime.Now.Ticks;
            Console.WriteLine("随机种子 UnityEngine.Random.seed = (int) DateTime.Now.Ticks;");
        }

        public void Start(){
            Console.WriteLine("==GameController-Start()");
            Console.WriteLine("设置起始场景");
            //设置起始场景
            sc.setState(new StartState(sc),"startState");
        }

        public void Update(){
            Console.WriteLine("==GameController-Update()");
            sc.stateUpdate();
        }
        
    }
}